import axios from 'axios'
const axiosInstance = axios.create({
  baseURL: '/api',
})

axiosInstance.interceptors.request.use(function (config) {
  // 在发送请求之前做些什么
  config.headers = {
    authorization: localStorage.getItem('token'),
  }
  return config
})

axiosInstance.interceptors.response.use(function (response) {
  return response.data
})

export default axiosInstance
